package org.particlethink.request;

import org.particlethink.aop.Id;
import org.particlethink.model.Acceptance;

import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

public class AcceptSubOrderRequest {
    @Id
    private Integer subOrderId;
    private List<String> images;
    private List<String> arriveImages;//图片

    private String carNumber;

    private List<AcceptGoodsInfo> goodsInfo;
    private String suggestion;


    public Acceptance updateAcceptance(Acceptance acceptance) {
        acceptance.setCarNumber(carNumber);
        acceptance.setImages(images);
        acceptance.setArriveImages(arriveImages);
        acceptance.setSuggestion(suggestion);

        return acceptance;
    }

    public Acceptance toAcceptance(Integer deliverId,Integer userId) {
        Acceptance acceptance = new Acceptance();
        acceptance.setCarNumber(this.getCarNumber());
        acceptance.setImages(this.getImages());
        acceptance.setArriveImages(this.getArriveImages());
        acceptance.setCreatorId(userId);
        acceptance.setSuggestion(this.getSuggestion());
        acceptance.setDeliverId(deliverId);
        acceptance.setCreatedAt(new Date());

        return acceptance;
    }


    public String getSuggestion() {
        return suggestion;
    }

    public void setSuggestion(String suggestion) {
        this.suggestion = suggestion;
    }

    public Integer getSubOrderId() {
        return subOrderId;
    }

    public void setSubOrderId(Integer subOrderId) {
        this.subOrderId = subOrderId;
    }


    public List<String> getImages() {
        return images;
    }

    public void setImages(List<String> images) {
        this.images = images;
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber;
    }


    public List<AcceptGoodsInfo> getGoodsInfo() {
        return goodsInfo;
    }

    public void setGoodsInfo(List<AcceptGoodsInfo> goodsInfo) {
        this.goodsInfo = goodsInfo;
    }

    public List<String> getArriveImages() {
        return arriveImages;
    }

    public void setArriveImages(List<String> arriveImages) {
        this.arriveImages = arriveImages;
    }

    public static class AcceptGoodsInfo {
        private Integer planMaterialId;
        private Integer goodsNum;
        private String remark;

        public Integer getPlanMaterialId() {
            return planMaterialId;
        }

        public void setPlanMaterialId(Integer planMaterialId) {
            this.planMaterialId = planMaterialId;
        }

        public Integer getGoodsNum() {
            return goodsNum;
        }

        public void setGoodsNum(Integer goodsNum) {
            this.goodsNum = goodsNum;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }
    }
}
